#include "../include/Buffer.hpp"

int main()
{
    Muduo::Buffer buf;
    std::string str;
    buf.WriteStringAndPush(str);
    Muduo::Buffer buf1(buf);
    std::cout << buf.ReadAbleSize() << std::endl;
    std::cout << buf.ReadAsStringAndPop(str.size()) << std::endl;
    std::cout << buf.ReadAbleSize() << std::endl;
    std::cout << buf1.ReadAbleSize() << std::endl;
    std::cout << buf1.ReadAsStringAndPop(str.size()) << std::endl;
    std::cout << buf1.ReadAbleSize() << std::endl;
    buf.Clear();

    for(int i = 0; i < 300; ++i)
    {
        str = "hello!!!" + std::to_string(i) + '\n';
        buf.WriteStringAndPush(str);
    }
    while(buf.ReadAbleSize() > 0)
    {
        std::cout << buf.GetLineAndPop();
    }
    std::cout << buf.ReadAsStringAndPop(buf.ReadAbleSize()) << std::endl;
    return 0;
}